home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 145 / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin / games / spassion / source.lzh / SOURCE / PLAYER.C < prev    next >
Text File  |  2000-03-31  |  17KB  |  524 lines

  1. /*
  2. #include <stdio.h>
  3. #include <iocslib.h>
  4. */
  5.  
  6. #include <XSP2lib.H>
  7. #include "SPASSION.H"
  8. #include "PLAYER.H"
  9. #include "SHOT.H"
  10. #include "EFFECT.H"
  11. #include "ENTRY.H"
  12. #include "PRIORITY.H"
  13. #include "BG.H"
  14. #include "SOUND.H"
  15. #include "SUB.H"
  16.  
  17. #define PLAYER_DIR1            6
  18. #define PLAYER_DIR2            12
  19.  
  20. #define PLAYER_X_APPEAR        ((16- 32) * DOT_RATE)        /* 登場時の初期値 */
  21. #define PLAYER_Y_APPEAR        ((16+128) * DOT_RATE)
  22. #define PLAYER_VX_APPEAR    (4 * DOT_RATE)                /* 登場時の移動量 */
  23. #define INIT_DEAD_COUNT 120
  24. #define INIT_DAMAGE_COUNT 40
  25. #define SHORT_LX( x )    (*((short *)(&x)))        /*lxの上位ワード*/
  26. #define SHORT_LY( y )    (*((short *)(&y)))        /*lyの上位ワード*/
  27.  
  28. #define CHARGE_TIME            60
  29. #define APP_PT                12
  30. #define SHI_PT                16
  31.  
  32. /*
  33.  *        自機・自弾のデータの初期化
  34.  */
  35. void    InitPlayer( PLAYER *player )
  36. {
  37.     short i;
  38.  
  39.     player->pt                = obj_player+2;
  40.     player->info            = PALET_PLAYER|PRIORITY_PLAYER;
  41.     player->lx                = PLAYER_X_APPEAR;            /* 座標 */
  42.     player->ly                = PLAYER_Y_APPEAR;            /* 座標 */
  43.     player->vx                = PLAYER_VX_APPEAR;            /* 登場時の移動量 */
  44.     player->vy                = 0;                        /* 登場時の移動量 */
  45.     player->state            = PLAYER_APPEAR;            /* プレイヤーの状態 */
  46.     player->shot_type        = 0;                        /* ショットの種類 */
  47.     player->charge            = 0;                        /* エネルギーチャージ数 */
  48.     player->dir                = 0;                        /* 自機の向いている方向 */
  49.     player->dead_count        = 0;                        /* 死ぬときのカウンタ ( 0 だと生きている ) */
  50.     player->muteki_count    = 0;                        /* 復活後の無敵カウンタ ( 0 だと通常 ) */
  51.     player->laser[0]        = 0;                        /* レーザーは出てるか(0だと出てない) */
  52.     player->laser[1]        = 0;
  53.     player->shot_count        = 0;                        /* 連射カウンタ ( 0 だと撃てる ) */
  54.     player->a_button_flag    = 0;                        /* A ボタンフラグ */
  55.     player->b_button_flag    = 0;                        /* B ボタンフラグ */
  56.     player->pointer            = 0;                        /* old_lx,old_lyの要素(オプション用) */
  57.     player->score            = 0;                        /* 点数 */
  58.     player->charge_sp.info    = 0x0400|PRIORITY_PLAYER+1;
  59.  
  60.     player->hit_x            = PLAYER_HIT_X;                /* 今回は値が一定なので使わない */
  61.     player->hit_y            = PLAYER_HIT_Y;
  62.  
  63.     /* 前回の座標 */
  64.     for(i=0;i<256;i++){
  65.         player->old_lx[i]    = PLAYER_X_APPEAR;
  66.         player->old_ly[i]    = PLAYER_Y_APPEAR;
  67.     }
  68.  
  69.     /* オプション用のデータを設定 */
  70.     player->option_type = DEF;
  71.     for(i=0;i<10;i++){
  72.         player->option[i].pt    = obj_option+1;
  73.         player->option[i].info    = PALET_PLAYER|PRIORITY_PLAYER;
  74.         player->option[i].shot_count    = 0;        /* 連射カウンタ ( 0 だと撃てる ) */
  75.         player->option[i].anim_count    = 0;        /* アニメーションカウント */
  76.         player->option[i].charge_sp.info=0x0400|PRIORITY_PLAYER+1;
  77.     }
  78.     player->option_charge=0;
  79.     game_over_state = GAME_PLAY;
  80. }
  81.  
  82. /* ------------ 自機移動 ----------- */
  83. void MovePlayer( PLAYER *player )
  84. {
  85.     int        vx[16]={0, 0, 0, 0,-131072,-92682,-92682, 0, 131072, 92682, 92682,0,0,0,0,0};
  86.     int        vy[16]={0,-131072, 131072, 0, 0,-92682, 92682, 0, 0,-92682, 92682,0,0,0,0,0};
  87.     char    joy,key,tr;
  88.     short    pt_dir=0,p,i,barrier_pt;
  89.     short    dir,fy[2]={64+16,192+16},y;        /*退場時に使う*/
  90.     extern SHOTINFO    shot_info[SHOT_TYPES][POW_LEVELS];
  91.     extern SHOTINFO    charge_shot_info;
  92.     extern SHOTINFO    opt_shot_info[SHOT_TYPES];
  93.     void    VdispRoutine( void );
  94. #if 0
  95.     B_CLR_AL();
  96.     B_LOCATE(0,0);
  97.     printf("option_charge=%d  \n",player->option_charge);
  98. #endif
  99.  
  100.     switch (player->state){
  101.     case PLAYER_ALIVE:        /* 生きている時 */
  102.         joy=GetKey( player->num, player->button_swap );
  103.         key=joy&0x0F;
  104.  
  105.         /* 移動量を足す */
  106.         player->lx+=(player->vx=vx[key]);
  107.         player->ly+=(player->vy=vy[key]);
  108.  
  109.         if( (*((short *)(&player->lx))) < PLAYER_MIN_X )
  110.             player->lx = PLAYER_MIN_X<<16;
  111.         if( (*((short *)(&player->lx))) > PLAYER_MAX_X )
  112.             player->lx = PLAYER_MAX_X<<16;
  113.         if( (*((short *)(&player->ly))) < PLAYER_MIN_Y )
  114.             player->ly = PLAYER_MIN_Y<<16;
  115.         if( (*((short *)(&player->ly))) > PLAYER_MAX_Y )
  116.             player->ly = PLAYER_MAX_Y<<16;
  117.         player->x = (*((short *)(&player->lx)));    /*lxの上位ワード*/
  118.         player->y = (*((short *)(&player->ly)));    /*lyの上位ワード*/
  119.  
  120.         if( key & KEY_UP ){
  121.             if( player->dir > -PLAYER_DIR2-6 )player->dir--;
  122.         }else
  123.         if( key & KEY_DOWN ){
  124.             if( player->dir <  PLAYER_DIR2+6 )player->dir++;
  125.         }
  126.         else{
  127.             if( player->dir > 0 )player->dir--;
  128.             else player->dir++;
  129.         }
  130.  
  131.         if( player->dir > PLAYER_DIR2 )      pt_dir=4;
  132.         else if( player->dir >  PLAYER_DIR1 )pt_dir=3;
  133.         else if( player->dir > -PLAYER_DIR1 )pt_dir=2;
  134.         else if( player->dir > -PLAYER_DIR2 )pt_dir=1;
  135.         else pt_dir=0;
  136.  
  137.         player->pt=obj_player+pt_dir;
  138.  
  139.         tr=joy&0xF0;
  140.         if( tr & B_BUTTON ){            /* Bボタンを押したときの処理 */
  141.             /*自機の攻撃*/
  142.             if( !player->shot_count ){
  143.                 ( *(shot_info[player->shot_type][player->pow_lev].func_shot_make) )( player,-1 );
  144.                 player->shot_count=shot_info[player->shot_type][player->pow_lev].interval;        /* 秒間 n 発 */
  145.             }
  146.             /*溜め撃ち*/
  147.             if( player->charge == CHARGE_TIME )
  148.                 ( *(charge_shot_info.func_shot_make) )( player,-1 );
  149.  
  150.             /*オプションの攻撃*/
  151.             if( player->option_type != MUTEKI ){        /* 無敵中には撃てない */
  152.                 for(i=0;i<2;i++){
  153.                     if( !player->option[i].shot_count ){
  154.                         ( *(opt_shot_info[player->option_type].func_shot_make) )( player,i );
  155.                         player->option[i].shot_count=opt_shot_info[player->option_type].interval;        /* 秒間 n 発 */
  156.                     }
  157.                 }
  158.             }
  159.             player->b_button_flag=1;
  160.             player->charge=0;
  161.             player->charge_sp.pt=0x00;
  162.         }else{
  163.             /* ボタンが離されてる間は、ショットタイプの切り換えと、溜めを行う */
  164.             /*ショットタイプ切り換え*/
  165.             if( player->b_button_flag ){
  166.                 if( player->shot_type == 0 )
  167.                     player->shot_type = 1;
  168.                 else
  169.                     player->shot_type = 0;
  170. /*                player->shot_count=0;*/        /* ショットカウンタリセット */
  171.             }
  172.             player->b_button_flag=0;
  173.  
  174.             /* 溜める */
  175.             if( ++player->charge >= CHARGE_TIME ){
  176.                 short    anim_num;
  177.                 player->charge = CHARGE_TIME;
  178.                 player->charge_sp.x=player->x+16-8;
  179.                 player->charge_sp.y=player->y-8;
  180.                 player->charge_sp.pt=obj_obj+0x1C+(anim_num=(++player->charge_sp.anim_count/4));
  181.                 if( anim_num > 4 ){
  182.                     player->charge_sp.pt = obj_obj+0x1C;
  183.                     player->charge_sp.anim_count = 0;
  184.                 }
  185.                 xsp_set_st( &player->charge_sp );
  186.             }
  187.         }
  188.  
  189.         if(player->shot_count > 0)player->shot_count--;
  190.         for(i=0;i<2;i++){
  191.             if(player->option[i].shot_count > 0)
  192.                 player->option[i].shot_count--;
  193.         }
  194.  
  195.         /*オプション変更*/
  196.         if( tr & A_BUTTON ){
  197.             if( player->option_type != MUTEKI ){            /* 無敵のときは切り換えられない */
  198.                 if( !player->a_button_flag ){
  199.                     if( ++player->option_type > ATT )
  200.                         player->option_type=DEF;
  201.                     player->a_button_flag = 1;
  202. /*                    player->option[0].shot_count=0;*/        /*注釈取れば連射できる*/
  203. /*                    player->option[1].shot_count=0;*/        /**/
  204.                     SetSE(SE_OPTION_CHANGE);
  205.                 }
  206.             }
  207.  
  208.             /* 溜める */
  209. /*            if( !player->muteki_count ){*/            /* 無敵のときは溜められない */
  210.             if( player->option_type != MUTEKI ){    /* 無敵のときは溜められない */
  211.             if( ++player->option_charge >= CHARGE_TIME ){
  212.                 short    anim_num;
  213.                 player->option_charge = CHARGE_TIME;
  214.                 player->option[0].charge_sp.x=player->option[0].x;
  215.                 player->option[0].charge_sp.y=player->option[0].y;
  216.                 player->option[0].charge_sp.pt=obj_obj+0x1C+(anim_num=(++player->option[0].charge_sp.anim_count/4));
  217.                 player->option[1].charge_sp.x=player->option[1].x;
  218.                 player->option[1].charge_sp.y=player->option[1].y;
  219.                 player->option[1].charge_sp.pt=obj_obj+0x1C+(anim_num=(++player->option[1].charge_sp.anim_count/4));
  220.                 if( anim_num > 4 ){
  221.                     player->option[0].charge_sp.pt = obj_obj+0x1C;
  222.                     player->option[0].charge_sp.anim_count = 0;
  223.                     player->option[1].charge_sp.pt = obj_obj+0x1C;
  224.                     player->option[1].charge_sp.anim_count = 0;
  225.                 }
  226.                 xsp_set_st( &player->option[0].charge_sp );
  227.                 xsp_set_st( &player->option[1].charge_sp );
  228.             }
  229.             }
  230.         }else{
  231.             player->a_button_flag=0;
  232.             if( player->option_charge >= CHARGE_TIME ){
  233.                 player->muteki_count=60*3;
  234.                 player->option_type=MUTEKI;
  235. /*                player->state=PLAYER_BARRIER;*/
  236.                 SetSE(SE_MUTEKI);
  237.             }
  238.             player->option_charge=0;
  239.         }
  240.  
  241. #if 0
  242.     /* デバッグ用パワーアップ */
  243.         {
  244.             static int flag=0;
  245.             if( BITSNS(0x03) & BIT(2) ){    /* P キーでレベルアップ */
  246.                 if( !flag ){
  247.                     flag=1;
  248.                     if(++player->pow_lev > 2 )
  249.                         player->pow_lev=0;
  250.                 }
  251.             }else
  252.                 flag=0;
  253.         }
  254. #endif
  255. /*if(!deb){*/
  256.         if( !player->muteki_count ){
  257.             if( CheckBGHit(player->x-16+CENTER_X,player->y-16)!=NON_BG ){
  258.                 player->state=PLAYER_DEAD;
  259.             }
  260.         }
  261. /*}*/
  262.  
  263.         break;
  264.     case PLAYER_APPEAR:            /* 自機登場 */
  265.         /* 今出現したところ */
  266.         if( player->vx==PLAYER_VX_APPEAR ){
  267.             if( PLAYER_X < 48 )
  268.                 player->pt=obj_player+APP_PT+0;
  269.             else if( PLAYER_X < 96 )
  270.                 player->pt=obj_player+APP_PT+1;
  271.             else if( PLAYER_X < 144 )
  272.                 player->pt=obj_player+APP_PT+2;
  273.             else if( PLAYER_X < 192 )
  274.                 player->pt=obj_player+APP_PT+3;
  275.             else
  276.                 player->vx=-2 * DOT_RATE;
  277.         }else{
  278.             if( PLAYER_X > 160 )
  279.                 player->pt=obj_player+APP_PT+2;
  280.             else if( PLAYER_X > 128 )
  281.                 player->pt=obj_player+APP_PT+1;
  282.             else if( PLAYER_X > 64 )
  283.                 player->pt=obj_player+APP_PT+0;
  284.             else
  285.                 player->state=PLAYER_ALIVE;
  286.         }
  287.         player->lx+=player->vx;
  288.         player->ly+=player->vy;
  289.         player->x = (*((short *)(&player->lx)));    /*lxの上位ワード*/
  290.         player->y = (*((short *)(&player->ly)));    /*lyの上位ワード*/
  291.         joy=GetKey( player->num, player->button_swap );
  292.         tr=joy&0xF0;
  293.         if( !(tr & B_BUTTON) ){
  294.             if( ++player->charge >= CHARGE_TIME )
  295.                 player->charge = CHARGE_TIME;
  296.         }
  297.         if( tr & A_BUTTON ){            /* Aボタンを押したときの処理 */
  298.             player->a_button_flag = 1;
  299.             if( ++player->option_charge >= CHARGE_TIME )
  300.                 player->option_charge=CHARGE_TIME;
  301.         }
  302.         break;
  303.     case PLAYER_LAST:    /* オールクリア */
  304.         if( play_mode==MODE_1P )y=128+16;
  305.         else y=fy[player->num];
  306.  
  307.         switch ( player->dead_count ){
  308.         case 2:        /* プレイヤーを画面中央に寄せる */
  309.             /* 中央までの距離 */
  310.             player->gx=player->x-128;if( player->gx < 0 )player->gx*=-1;
  311.             player->gy=player->y-y  ;if( player->gy < 0 )player->gy*=-1;
  312.  
  313.             /* 移動速度を求める */
  314.             dir=calc_direction(player->x, player->y,128,y);
  315.             player->vx=vx_tbl[10][dir];
  316.             player->vy=vy_tbl[10][dir];
  317.             player->dead_count--;
  318.             break;
  319.         case 1:    /* 中央まで来たか? */
  320.             if( player->gx > player->gy ){
  321.                 if( player->vx > 0 ){
  322.                     if( player->x >= 128 )
  323.                         player->dead_count=0;
  324.                 }else{
  325.                     if( player->x <= 128 )
  326.                         player->dead_count=0;
  327.                 }
  328.             }else{
  329.                 if( player->vy > 0 ){
  330.                     if( player->y >= y )
  331.                         player->dead_count=0;
  332.                 }else{
  333.                     if( player->y <= y )
  334.                         player->dead_count=0;
  335.                 }
  336.             }
  337.             /* 自機の傾きの処理 */
  338.             if( player->vy < 0 ){
  339.                 if( player->dir > -PLAYER_DIR2-6 )player->dir--;
  340.             }else if( player->vy > 0 ){
  341.                 if( player->dir <  PLAYER_DIR2+6 )player->dir++;
  342.             }else{
  343.                 if( player->dir > 0 )player->dir--;
  344.                 else player->dir++;
  345.             }
  346.             if( player->dir > PLAYER_DIR2 )      pt_dir=4;
  347.             else if( player->dir >  PLAYER_DIR1 )pt_dir=3;
  348.             else if( player->dir > -PLAYER_DIR1 )pt_dir=2;
  349.             else if( player->dir > -PLAYER_DIR2 )pt_dir=1;
  350.             else pt_dir=0;
  351.             player->pt=obj_player+pt_dir;
  352.             break;
  353.         case 0:        /* 自機退場 */
  354.             player->vx+=8192;
  355.             player->vy=0;
  356.             if( PLAYER_X < 128+16 )
  357.                 player->pt=obj_player+APP_PT+0;
  358.             else if( PLAYER_X < 160 )
  359.                 player->pt=obj_player+APP_PT+1;
  360.             else if( PLAYER_X < 192 )
  361.                 player->pt=obj_player+APP_PT+2;
  362.             else if( PLAYER_X < 224 )
  363.                 player->pt=obj_player+APP_PT+3;
  364.  
  365.             if( (*((short *)(&player->lx)))>PLAYER_MAX_X+60 )
  366.                 player->state=PLAYER_WAIT;
  367.         }
  368.         player->lx+=player->vx;
  369.         player->ly+=player->vy;
  370.         player->x = (*((short *)(&player->lx)));    /*lxの上位ワード*/
  371.         player->y = (*((short *)(&player->ly)));    /*lyの上位ワード*/
  372.  
  373.         break;
  374.     /* 待機 */
  375.     case PLAYER_WAIT:
  376.         player->lx = PLAYER_X_APPEAR;        /* 座標 */
  377.         player->ly = PLAYER_Y_APPEAR;        /* 座標 */
  378.         player->vx = PLAYER_VX_APPEAR;
  379.         player->vy = 0;
  380.         player->muteki_count = 0;
  381.         player->option_charge=0;
  382.         if( player->option_type==MUTEKI )
  383.             player->option_type--;
  384.         for(i=0;i<256;i++){
  385.             player->old_lx[i]=PLAYER_X_APPEAR;
  386.             player->old_ly[i]=PLAYER_Y_APPEAR;
  387.         }
  388.         return;
  389.         break;
  390.     /* 死んでいる時 */
  391.     case PLAYER_DEAD:
  392.         player->option[0].lx=player->option[0].ly=0;
  393.         player->option[1].lx=player->option[1].ly=0;
  394.  
  395.         player->pt = obj_player+5+(++player->dead_count)/4;
  396.         if( player->pt <= obj_player+5+6 )
  397.             xobj_set_st( player );
  398.         if( player->dead_count == 1 )
  399.             SetSE(SE_PLAYER_EXPL);
  400.         if( player->dead_count == 28 ){
  401.             MakeEffect(EFFECT_EXPLPLAYER, 0, player->x, player->y);
  402.             player->lx = PLAYER_X_APPEAR;        /* 座標 */
  403.             player->ly = PLAYER_Y_APPEAR;        /* 座標 */
  404.             player->x = (*((short *)(&player->lx)));    /*lxの上位ワード*/
  405.             player->y = (*((short *)(&player->ly)));    /*lyの上位ワード*/
  406.             player->vx = PLAYER_VX_APPEAR;
  407.             player->vy = 0;
  408.         }
  409.         if( player->dead_count > 60 ){
  410.             player->muteki_count=60*4;
  411.             player->charge=0;
  412.             player->option_charge=0;
  413.             if( (--player->left)<0 ){        /* 全滅した */
  414.                 player->left++;                /* 0未満にできないので */
  415.                 player->state = PLAYER_WAIT;
  416.                 game_state=IN_GAME_OVER;
  417.                 xsp_vsyncint_on(&VdispRoutine);
  418.             }else{
  419.                 player->pow_lev=0;
  420.                 player->state = PLAYER_APPEAR;
  421.                 player->dead_count = 0;
  422.                 for(i=0;i<256;i++){
  423.                     player->old_lx[i]=PLAYER_X_APPEAR;
  424.                     player->old_ly[i]=PLAYER_Y_APPEAR;
  425.                 }
  426.             }
  427.         }
  428.         return;
  429.         break;
  430.     }
  431.  
  432.     /* 無敵状態 */
  433.     player->info = PALET_PLAYER | PRIORITY_PLAYER;
  434.     if( player->muteki_count ){
  435.         player->muteki_count--;
  436.         player->flash_count++;
  437.         /* バリアが沢山残っているので速いフラッシュ */
  438.         if (player->muteki_count > 55) {
  439.             if (player->flash_count > 1) {
  440. /*                player->info = PALET_PLAYER_FLASH | PRIORITY_PLAYER;*/
  441.                 player->info = 0x0000;
  442.                 player->flash_count = 0;
  443.             }
  444.         } else {
  445.         /* バリアが少ししかないので遅いフラッシュ */
  446.             if (player->flash_count > 5)
  447. /*                player->info = PALET_PLAYER_FLASH | PRIORITY_PLAYER;*/
  448.                 player->info = 0x0000;
  449.             if (player->flash_count > 10)
  450.                 player->flash_count = 0;
  451.  
  452.             if (player->muteki_count <= 0){
  453.                 if( player->option_type==MUTEKI )
  454.                     player->option_type--;
  455. /*                player->state = PLAYER_ALIVE;*/    /* バリア切れ */
  456.             }
  457.         }
  458.     }
  459.  
  460.  
  461.     /*オプション*/
  462.     if( player->option_anim_count==0 )
  463.         player->option_anim_count=4;
  464.     else
  465.         player->option_anim_count=0;
  466.  
  467.     switch( player->option_type ){
  468.     case DEF:        /*防御型*/
  469.         player->option[0].lx=player->old_lx[p=((player->pointer-4) & 255)];
  470.         player->option[0].ly=player->old_ly[p]-48*DOT_RATE;
  471.         player->option[1].lx=player->old_lx[p];
  472.         player->option[1].ly=player->old_ly[p]+48*DOT_RATE;
  473.         break;
  474.     case ATT:        /*攻撃型*/
  475.         player->option[0].anim_count=(player->option[0].anim_count+4)&255;
  476.         player->option[0].lx=player->old_lx[(player->pointer-4) & 255]+5*DOT_RATE+vx_tbl[30][player->option[0].anim_count];
  477.         player->option[0].ly=player->old_ly[(player->pointer-4) & 255]+           vy_tbl[30][player->option[0].anim_count];
  478.         player->option[1].anim_count=(player->option[0].anim_count+128)&255;
  479.         player->option[1].lx=player->old_lx[(player->pointer-4) & 255]+5*DOT_RATE+vx_tbl[30][player->option[1].anim_count];
  480.         player->option[1].ly=player->old_ly[(player->pointer-4) & 255]+           vy_tbl[30][player->option[1].anim_count];
  481.         break;
  482.     case MUTEKI:    /*自機無敵*/
  483.         player->option[0].anim_count=(player->option[0].anim_count+8)&255;
  484.         player->option[0].lx=player->old_lx[(player->pointer-4) & 255]+5*DOT_RATE+vx_tbl[29][player->option[0].anim_count];
  485.         player->option[0].ly=player->old_ly[(player->pointer-4) & 255]+           vy_tbl[29][player->option[0].anim_count];
  486.         player->option[1].anim_count=(player->option[0].anim_count+128)&255;
  487.         player->option[1].lx=player->old_lx[(player->pointer-4) & 255]+5*DOT_RATE+vx_tbl[29][player->option[1].anim_count];
  488.         player->option[1].ly=player->old_ly[(player->pointer-4) & 255]+           vy_tbl[29][player->option[1].anim_count];
  489.         /* シールド */
  490.         player->option[2].lx=player->lx+3*DOT_RATE;
  491.         player->option[2].ly=player->ly;
  492.         player->option[2].x = (*((short *)(&player->option[2].lx)));    /*lxの上位ワード*/
  493.         player->option[2].y = (*((short *)(&player->option[2].ly)));    /*lyの上位ワード*/
  494.  
  495.         if( (barrier_pt=(++player->option[2].anim_count)/4) > 4 ){
  496.             player->option[2].anim_count=0;
  497.             barrier_pt=0;
  498.         }
  499.         player->option[2].pt=obj_player+SHI_PT+barrier_pt;
  500.         if( player->muteki_count < 60*1 )        /* 制限時間が近づいたら色を変える */
  501.             player->option[2].info            = 0x033F|PRIORITY_PLAYER;
  502.         else
  503.             player->option[2].info            = 0x043F|PRIORITY_PLAYER;
  504.         xobj_set_st( &player->option[2] );
  505.         break;
  506.     }
  507.     for(i=0;i<2;i++){
  508.         short    x,y;
  509.         player->option[i].pt=obj_option+pt_dir/2+player->option_anim_count;
  510.         player->option[i].x = (*((short *)(&player->option[i].lx)))-8;    /*lxの上位ワード*//*-8は表示位置をずらすため*/
  511.         player->option[i].y = (*((short *)(&player->option[i].ly)))-8;    /*lyの上位ワード*/
  512.         xsp_set_st( &player->option[i] );
  513.         /* BGとの当たり判定 */
  514.         if( CheckBGHit(x=player->option[i].x-16+8,y=player->option[i].y-16+8)==ERASE_BG )
  515.             BreakBG( x, y );
  516.     }
  517.     player->old_lx[player->pointer]=player->lx;
  518.     player->old_ly[player->pointer]=player->ly;
  519.     player->pointer++;
  520.     player->pointer&=255;
  521.  
  522.     xobj_set_st( player );
  523. }
  524.